package com.ruoyi.farm.biz.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.farm.api.domain.ScoringDimension;
import com.ruoyi.farm.biz.mapper.ScoringDimensionMapper;
import com.ruoyi.farm.biz.service.IScoringDimensionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 评分维度Service业务层处理
 * 
 * @author Andy
 * @date 2022-07-24
 */
@Service
public class ScoringDimensionServiceImpl implements IScoringDimensionService
{
    @Autowired
    private ScoringDimensionMapper scoringDimensionMapper;

    /**
     * 查询评分维度
     * 
     * @param id 评分维度主键
     * @return 评分维度
     */
    @Override
    public ScoringDimension selectScoringDimensionById(Long id)
    {
        return scoringDimensionMapper.selectScoringDimensionById(id);
    }

    /**
     * 查询评分维度列表
     * 
     * @param scoringDimension 评分维度
     * @return 评分维度
     */
    @Override
    public List<ScoringDimension> selectScoringDimensionList(ScoringDimension scoringDimension)
    {
        return scoringDimensionMapper.selectScoringDimensionList(scoringDimension);
    }

    /**
     * 新增评分维度
     * 
     * @param scoringDimension 评分维度
     * @return 结果
     */
    @Override
    public int insertScoringDimension(ScoringDimension scoringDimension)
    {
        scoringDimension.setCreateTime(DateUtils.getNowDate());
        return scoringDimensionMapper.insertScoringDimension(scoringDimension);
    }

    /**
     * 修改评分维度
     * 
     * @param scoringDimension 评分维度
     * @return 结果
     */
    @Override
    public int updateScoringDimension(ScoringDimension scoringDimension)
    {
        scoringDimension.setUpdateTime(DateUtils.getNowDate());
        return scoringDimensionMapper.updateScoringDimension(scoringDimension);
    }

    /**
     * 批量删除评分维度
     * 
     * @param ids 需要删除的评分维度主键
     * @return 结果
     */
    @Override
    public int deleteScoringDimensionByIds(Long[] ids)
    {
        return scoringDimensionMapper.deleteScoringDimensionByIds(ids);
    }

    /**
     * 删除评分维度信息
     * 
     * @param id 评分维度主键
     * @return 结果
     */
    @Override
    public int deleteScoringDimensionById(Long id)
    {
        return scoringDimensionMapper.deleteScoringDimensionById(id);
    }
}
